package com.kaka.bus.adapter;

import android.app.Activity;
import android.support.annotation.Nullable;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.kaka.bus.R;
import com.kaka.bus.bean.ProductDetailBean;

import java.util.List;

public class ManageAmountAdapter extends BaseQuickAdapter<ProductDetailBean, BaseViewHolder> {
    private Activity mActivity;

    public ManageAmountAdapter(Activity activity, int layoutResId, @Nullable List<ProductDetailBean> data) {
        super(layoutResId, data);
        mActivity = activity;
    }

    @Override
    protected void convert(BaseViewHolder helper, ProductDetailBean item) {
        ImageView imageView = helper.getView(R.id.img_icon);
        Glide.with(mActivity)
                .load(item.getProductIcon()).error(R.drawable.icon_kakadef)
                .into(imageView);
        helper.setText(R.id.tv_title, item.getProductName());

        helper.setText(R.id.tv_subtitle, item.getSubhead());
    }
}
